import request from '@/config/axios'

export interface CourseAssemblyVO {
  id: number
  parentId: number
  taskNumber: string
  productNumber: string
  productName: string
  modelSpecification: string
  orderQuantity: number
  code: string
  partNumber: string
  partName: string
  drawingNumber: string
  partSpecification: string
  planEndDate: string
  planQuantity: number
  reportQuantity: number
  completeQuantity: number
  differenceQuantity: number
  productionTeam: string
  deviceName: string
  deviceCode: string
  processPrice: number
  creatorName: string
  updaterName: string
  planStartDate: string
  operator: string
  operatorJobNumber: string
  dictProcessName: number
  dictStatus: number
}

// 查询生产管理-过程管理-组装管理列表
export const getCourseAssemblyPage = async (params) => {
  return await request.get({ url: `/produce/course-assembly/page`, params })
}

// 查询生产管理-过程管理-组装管理详情
export const getCourseAssembly = async (id: number) => {
  return await request.get({ url: `/produce/course-assembly/getDetail?id=` + id })
}

// 新增生产管理-过程管理-组装管理
export const createCourseAssembly = async (data: CourseAssemblyVO) => {
  return await request.post({ url: `/produce/course-assembly/create`, data })
}

// 修改生产管理-过程管理-组装管理
export const updateCourseAssembly = async (data: CourseAssemblyVO) => {
  return await request.put({ url: `/produce/course-assembly/update`, data })
}

// 删除生产管理-过程管理-组装管理
export const deleteCourseAssembly = async (id: number) => {
  return await request.delete({ url: `/produce/course-assembly/delete?id=` + id })
}

// 导出生产管理-过程管理-组装管理 Excel
export const exportCourseAssembly = async (data) => {
  return await request.download({ url: `/produce/course-assembly/export-excel`, data })
}

// 生产管理-过程管理-组装管理指派
export const assignCourseAssembly = async (data) => {
  return await request.put({ url: `/produce/course-assembly/assign`, data })
}
